<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class ActivitySale extends Model
{
    protected $table = 'activity_sale';
    public $timestamps = false;
    protected $fillable = [
        'activity_name',
        'activity_type',
        'rule_type',
        'full',
        'less',
        'scope',
        'not_in_goods',
        'start_at',
        'end_at',
        'amount',
        'amount_use',
        'status',
        'issue_type',
        'activity_time',
        'activity_type_id',
        'updated_at',
    ];

    //状态
    const STATUS_TRUE = 1;
    const STATUS_FAIL = 2;
    //有效范围
    const SCOPE_FUll = 1;
    const SCOPE_PART = 2;
    //规则类型
    const TYPE_ONE = 1;
    const TYPE_TWO = 2;
    //活动类型
    const RULE_TYPE_ONE = 1;
    const RULE_TYPE_TWO = 2;

    const ACTIVITY_STATUS = [
        self::STATUS_TRUE => '启用',
        self::STATUS_FAIL => '停用',
    ];
    const ACTIVITY_TYPE = [
        self::TYPE_ONE => '满减活动',
        self::TYPE_TWO => '优惠券',
    ];
    const RULE_TYPE = [
        self::RULE_TYPE_ONE => '立减',
        self::RULE_TYPE_TWO => '满减',
    ];
    const SCOPE_TYPE = [
        self::SCOPE_FUll => '全部商品',
        self::SCOPE_PART => '部分商品',
    ];
}
